<?php

namespace Controller\Ajax;

class Hello extends Base {

    public function addReply() {
        $this->mustLogin();
        $helloId = $this->postInt('helloId');
        $content = $this->postParam('content', true);
        $content = trim($content);
        if (!$helloId) {
            $this->responseError('参数错误');
        }
        if (!$content) {
            $this->responseError('参数错误');
        }
        $content = \Lib\Util\Comm::utf8_truncate($content, 300);
        $userId = $this->currentUserInfo['UserId'];
        \Business\User::instance()->addHelloReply($helloId, $userId, $content);
    }
}